<template>
  <div>
    <button v-for="item in menulist" :key="item.comName" @click="comName = item.comName">切换nav</button>
    <!-- <button @click="comName = 'MySwiper'">切换swiper</button> -->
    <component :is="comName"></component>
  </div>
</template>

<script>
import MyNav from '@/components/my-nav.vue'
import MySwiper from '@/components/my-swiper.vue'
import MyLogin from '@/components/my-login.vue'
export default {
  components: {
    MyNav,
    MySwiper,
    MyLogin,
  },
  data() {
    return {
      comName: 'MyNav',
      menulist: [
        {
          label: '切换nav',
          comName:'MyNav',
        },
        {
          label: '切换swiper',
          comName:'MySwiper',
        },
        {
          label: '切换login',
          comName:'MyLogin',
        },
      ]
    }
  },
}
</script>

<style scoped></style>
